<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.yaodian100.com/jsp/yaodian100" prefix="yaodian100" %>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<c-rt:set var="frontContextPath" value='<%=ServerValue.getFrontContextPath()%>'/>
<%@page import="com.yaodian100.ec.member.entity.Member"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%Member member = (Member)request.getAttribute("member");%>
<script language="javascript">
$().ready( function() {
	$("#current_location").html('&nbsp;&gt;&nbsp;账户余额&nbsp;-&nbsp;账户余额纪录');
	$("#m_myBank").css("font-weight","bold");
	$("#deny_dialog").dialog({
		bgiframe: true,
		autoOpen: false,
		height: 150,
		width:350,
		modal: true
	});
	$("#trust_dialog").dialog({
		bgiframe: true,
		width:290,
		autoOpen: false,
		modal: true
	});
	$("#trusr_commit").click(function(){
		$("#trust_dialog").dialog('close');
	});
	$("#cashout").click(function(){
		<% if(ServerValue.getTrustMembers().contains(member.getApplySource())){%>
			$("#trust_dialog").dialog('open');
		<% }else{%>
		$.post("${frontContextPath}/member/applyCashOut/checkVirtualBalance.do",{},callback,"json");
		function callback(virtualBalanceResult){
			if ( virtualBalanceResult != "" ){
				$("#deny_msg").text(virtualBalanceResult);
				$("#deny_dialog").dialog('open');
			}else
				location.href = "${frontContextPath}/member/applyCashOut/policy.do";
		}
		<%}%>
	});
});
</script>
<div id="deny_dialog" title="申请提现" class="member-reg-alert" style="display:none">
<p id="deny_msg"></p>
</div>
<!-- 我的訂單 -->
<h2>账户余额</h2>
<!-- 帳戶狀況 -->
<div class="my-accounut c-f"><span><strong>账户余额：</strong><br />
<b><fmt:formatNumber value="${member.balance.virtualBalance}" pattern="#####0.0#"/></b>元</span></div>

<div class="mb-show">
<ul class="mb-tab">
	<li class="mb-tab-f"><a href="#">账户余额记录</a></li>
	<li><a href="#" id="cashout">申请提现</a></li>
</ul>

<!-- 帳戶狀況 -->
<p class="bg-yl" align="right">共${virtualBalanceSize}笔： ${pager.currentPage+1}/${pager.pageSize}
<c-rt:choose><c-rt:when test="${pager.currentPage==0}">
	<span class="a-no">&lt; 上一页</span> |
</c-rt:when><c-rt:otherwise>
	<a href="${frontContextPath}/member/myBank/myBank.do?virtualType=${virtualType}&pager.currentPage=${pager.currentPage-1}">&lt; 上一页</a> |
</c-rt:otherwise></c-rt:choose>
<c-rt:choose><c-rt:when test="${pager.currentPage == pager.pageSize-1}">
	<span class="a-no">下一页 &gt;</span>
</c-rt:when><c-rt:otherwise>
	<a href="${frontContextPath}/member/myBank/myBank.do?virtualType=${virtualType}&pager.currentPage=${pager.currentPage+1}" class="a-togo">下一页 &gt;</a>
</c-rt:otherwise></c-rt:choose>
</p>
<div class="a-pick-links">
	<c-rt:choose><c-rt:when test="${virtualType==null||virtualType==''}">
	<strong>所有帐户活动</strong> |
	</c-rt:when><c-rt:otherwise>
	<a class="a-blue" href="${frontContextPath}/member/myBank/myBank.do">所有帐户活动</a> |
	</c-rt:otherwise></c-rt:choose>
	
	<c-rt:choose><c-rt:when test="${virtualType=='0'}">
	<strong>存入记录</strong> |
	</c-rt:when><c-rt:otherwise>
	<a class="a-blue" href="${frontContextPath}/member/myBank/myBank.do?virtualType=0">存入记录</a> | 
	</c-rt:otherwise></c-rt:choose>
	
	<c-rt:choose><c-rt:when test="${virtualType=='1'}">
	<strong>支付记录</strong> |
	</c-rt:when><c-rt:otherwise>
	<a class="a-blue" href="${frontContextPath}/member/myBank/myBank.do?virtualType=1">支付记录</a> |  
	</c-rt:otherwise></c-rt:choose>
	
	<c-rt:choose><c-rt:when test="${virtualType=='2'}">
	<strong>提现记录</strong>
	</c-rt:when><c-rt:otherwise>
	<a class="a-blue" href="${frontContextPath}/member/myBank/myBank.do?virtualType=2">提现记录</a>  
	</c-rt:otherwise></c-rt:choose>
</div>
<table width="100%" border="0" class="tb-2">
	<tr>
		<th width="100">日期</th>
		<th>说明</th>
		<th width="90">金额</th>
		<th>余额</th>
	</tr>
	<c-rt:choose><c-rt:when test="${virtualBalanceSize==0}">
		<tr><td colspan="4">您没有任何记录。</td></tr>
	</c-rt:when><c-rt:otherwise>
	<c-rt:forEach items="${virtualBalanceList}" var="virtualBalance">
		<tr>
			<td><fmt:formatDate value="${virtualBalance.trxDate}" pattern="yyyy-MM-dd"/></td>
			<td>
				<p>${virtualBalance.description}</p>
			</td>
			<td class="txt-price"><fmt:formatNumber value="${virtualBalance.trxAmount}" pattern="#####0.0#"/></td>
			<td class="txt-price"><fmt:formatNumber value="${virtualBalance.summaryAmount}" pattern="#####0.0#"/></td>
		</tr>
	</c-rt:forEach>
	</c-rt:otherwise></c-rt:choose>
</table>

<yaodian100:pager10 pagerObj="${pager}" link="${frontContextPath}/member/myBank/myBank.do?virtualType=${virtualType}"/>

<!-- 注意事项 -->
<div class="txt-note">
<ul>
	<li>．账户余额是您在耀点100网站留下的现金。</li>
	<li>．在订单结算时，若您的帐户尚有余额未使用，您可用来支付其余货款。</li>
</ul>
</div>
</div>
<div id="dialog"></div>
<div id="trust_dialog" title="申请提现" class="alert-caution" style="display:none;">
         <p>请您拨打客服电话：4001-168-100<br />
我们将为您进行提现处理。</p>
         <div align="center"><a href="javascript:;" class="btn-mid" onfocus="blur()" id="trusr_commit">确定</a></div>
</div>